angular
    .module("backendApp")
    .config(["$translateProvider","tmhDynamicLocaleProvider",function($translateProvider,tmhDynamicLocaleProvider){
        $translateProvider.translations("es-es",{
            "menu":{
                "SELECT_IDIOMA":"Idioma : Espanol",
                "APP":"Aplicaciones",
                "TEST01":"Prueba 01",
                "TEST02":"Prueba 02",
                "lang01":"Espanol - ( PERU )",
                "lang02":"Ingles  - ( EEUU )",
                "bandera":"flag_peru.png"
            },
            "inicio":{
                "P_A":"Portal Academico",
                "B_U":"Bienestar Universitario",
                "D_E":"Desarrollo Espiritual",
                "S_G":"Secretaria general",
                "EGR":"Egresados",
                "R_H":"Recursos Humanos",
                "F_C":"Financiero Contable",
                "I_C":"Inf. y Comunicacion",
                "LOG":"Logistica",
                "G_C":"Gestion de la Calidad",
                "CNI":"Coop. Internacional",
                "V_T":"Videos Tutoriales",
                "P_F":"Preguntas Frecuentes",
                "MODULES":"Modulos",
                "MOD_CONTENT":"Accesos con los que usted cuenta:",
                "HELP":"Necesitas Ayuda?",
                "HELP_CONTENT":"Encontraras material relacionado a traves de los siguientes links.",
                "SETTINGS":"Ajustes"
            },"btn":{
                "add":"Agregar",
                "delete":"Eliminar",
                "new":"Nuevo",
                "create":"Crear",
                "save":"Guardar",
                "back":"Regresar",
                "cancel":"Cancelar",
                "clear":"Limpiar",
                "print":"Imprimir"
            }
        });
        $translateProvider.translations("en-us",{
            "menu":{
                "SELECT_IDIOMA":"Idioma : ingles",
                "APP":"Applications",
                "TEST01":"Test 01",
                "TEST02":"Test 02",
                "lang01":"Spanish - ( PERU )",
                "lang02":"English - ( USA )",
                "bandera":"flag_eeuu.png"
            },
            "inicio":{
                "P_A":"Academic",
                "B_U":"Welfare University",
                "D_E":"Spiritual Development",
                "S_G":"General Secretary",
                "EGR":"Graduates",
                "R_H":"Human Resources",
                "F_C":"Financial Accounting",
                "I_C":"Communication",
                "LOG":"Logistics",
                "G_C":"Quality Management",
                "CNI":"International Relations",
                "V_T":"Tutorial Videos",
                "P_F":"Questions",
                "MODULES":"Modules",
                "MOD_CONTENT":"these are the hits with you account.",
                "HELP":"Do you need more help?",
                "HELP_CONTENT":"You find related material through the following links.",
                "SETTINGS":"Settings"
            },"btn":{
                "add":"Add",
                "delete":"Delete",
                "new":"New",
                "create":"Create",
                "save":"Save",
                "back":"Back",
                "cancel":"Cancel",
                "clear":"Clear",
                "print":"Print"
            }
        });
        tmhDynamicLocaleProvider.localeLocationPattern("node_modules/angular-locale/dist/angular-locale_{{ locale }}.js");
        $translateProvider.useSanitizeValueStrategy('escape');
    }])
    .run(["$window","$translate","tmhDynamicLocale",function($window,$translate,tmhDynamicLocale){
       var language = ($window.navigator.userLanguage || $window.navigator.language).indexOf("en")==0 ? "en-us":"es-es";        
        $translate.use(language);
        tmhDynamicLocale.set(language);
    }]);
    